import { MockMethod } from "vite-plugin-mock"

export default [
  {
    url: "/dev-api/system/menu/search",
    timeout: 5000,
    method: "post",
    response: () => {
      return {
        "status": 200,
        "msg": "查询成功",
        "data": {
          "msg": "成功获取系统菜单",
          "results": [
            {
              "id": "1",
              "parentId": null,
              "type": "1",
              "path": "/home",
              "name": "Home", // 路由名称
              "code": "home", // 权限标识
              "redirect": null,
              "component": "home/index.vue",
              "meta": {
                "title": "首页",
                "icon": "i-fe-home",
                "cache": true,
                "hidden": false,
                "isBreadcrumd": true
              },
              "sort": 1,
              "remarks": "@ctitle",
              "createTime": "@date",
              "updateTime": "@date",
              "children": []
            },
            {
              "id": "2",
              "parentId": null,
              "type": "1",
              "path": "/system",
              "name": "System",
              "code": "system",
              "redirect": "/system/menu",
              "component": null,
              "meta": {
                "title": '系统管理',
                "icon": 'i-fe-settings',
                "cache": true,
                "hidden": false,
                "isBreadcrumd": true
              },
              "sort": 2,
              "remarks": "@ctitle",
              "createTime": "@date",
              "updateTime": "@date",
              "children": [
                {
                  "id": "21",
                  "parentId": "2",
                  "type": "1",
                  "path": '/system/menu',
                  "name": 'SystemMenu',
                  "code": "system:menu",
                  "redirect": null,
                  "component": "system/menu/index.vue",
                  "meta": {
                    "title": '菜单管理',
                    "icon": 'i-fe-grid',
                    "cache": true,
                    "hidden": false,
                    "isBreadcrumd": true,
                  },
                  "sort": 1,
                  "remarks": "@ctitle",
                  "createTime": "@date",
                  "updateTime": "@date",
                  "children": [{
                    "id": "211",
                    "parentId": "21",
                    "type": "2", // 2 操作按钮
                    "path": null,
                    "name": null,
                    "redirect": null,
                    "code": "system:menu:search",
                    "meta": {
                      "title": "查询列表",
                      "icon": null,
                      "cache": true,
                      "hidden": true,
                    },
                    "sort": 1,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "212",
                    "parentId": "21",
                    "type": "2",
                    "path": null,
                    "name": null,
                    "redirect": null,
                    "code": "system:menu:add",
                    "meta": {
                      "title": "新增菜单",
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 2,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "213",
                    "parentId": "21",
                    "type": "2",
                    "path": null,
                    "name": null,
                    "redirect": null,
                    "code": "system:child:add",
                    "meta": {
                      "title": "新增下级",
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 3,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "214",
                    "parentId": "21",
                    "type": "2",
                    "name": null,
                    "path": null,
                    "redirect": null,
                    "code": "system:menu:edit",
                    "meta": {
                      "title": "修改菜单",
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 4,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "215",
                    "parentId": "21",
                    "type": "2",
                    "name": null,
                    "path": null,
                    "redirect": null,
                    "code": "system:menu:delete",
                    "meta": {
                      "title": "删除菜单",
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 5,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  }
                  ]
                },
                {
                  "id": "22",
                  "parentId": "2",
                  "type": "1",
                  "path": '/system/role',
                  "name": 'SystemRole',
                  "code": "system:role",
                  "redirect": null,
                  "component": "system/role/index.vue",
                  "meta": {
                    "title": '角色管理',
                    "icon": 'i-fe-users',
                    "cache": true,
                    "hidden": false,
                    "isBreadcrumd": true,
                  },
                  "sort": 2,
                  "remarks": "@ctitle",
                  "createTime": "@date",
                  "updateTime": "@date",
                  "children": [{
                    "id": "221",
                    "parentId": "22",
                    "type": "2",
                    "name": null,
                    "path": null,
                    "redirect": null,
                    "code": "system:role:search",
                    "meta": {
                      "title": '查询角色',
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 1,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "222",
                    "parentId": "22",
                    "type": "2",
                    "name": null,
                    "path": null,
                    "redirect": null,
                    "code": "system:role:add",
                    "meta": {
                      "title": '新增角色',
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 2,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "223",
                    "parentId": "22",
                    "type": "2",
                    "name": null,
                    "path": null,
                    "redirect": null,
                    "code": "system:role:edit",
                    "meta": {
                      "title": '修改角色',
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 3,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "224",
                    "parentId": "22",
                    "type": "2",
                    "name": null,
                    "path": null,
                    "redirect": null,
                    "code": "system:role:delete",
                    "meta": {
                      "title": '删除角色',
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 4,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "225",
                    "parentId": "22",
                    "type": "2",
                    "name": null,
                    "path": null,
                    "redirect": null,
                    "code": "system:role:menu",
                    "meta": {
                      "title": '分配权限',
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 5,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  }
                  ]
                },
                {
                  "id": "23",
                  "parentId": "2",
                  "type": "1",
                  "path": '/system/user',
                  "name": 'SystemUser',
                  "code": "system:user",
                  "redirect": null,
                  "component": "system/user/index.vue",
                  "meta": {
                    "title": '用户管理',
                    "icon": 'i-fe-user',
                    "cache": true,
                    "hidden": false,
                    "isBreadcrumd": true,
                  },
                  "sort": 3,
                  "remarks": "@ctitle",
                  "createTime": "@date",
                  "updateTime": "@date",
                  "children": [{
                    "id": "231",
                    "parentId": "23",
                    "type": "2",
                    "path": null,
                    "name": null,
                    "redirect": null,
                    "code": "system:user:search",
                    "meta": {
                      "title": "查询用户",
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 1,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "232",
                    "parentId": "23",
                    "type": "2",
                    "path": null,
                    "name": null,
                    "redirect": null,
                    "code": "system:user:add",
                    "meta": {
                      "title": "新增用户",
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 2,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "234",
                    "parentId": "23",
                    "type": "2",
                    "path": null,
                    "name": null,
                    "redirect": null,
                    "code": "system:user:edit",
                    "meta": {
                      "title": "修改用户",
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 3,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "235",
                    "parentId": "23",
                    "type": "2",
                    "path": null,
                    "name": null,
                    "redirect": null,
                    "code": "system:user:delete",
                    "meta": {
                      "title": "删除用户",
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 4,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  {
                    "id": "236",
                    "parentId": "23",
                    "type": "2",
                    "path": null,
                    "name": null,
                    "redirect": null,
                    "code": "system:user:password",
                    "meta": {
                      "title": "密码重置",
                      "icon": null,
                      "cache": true,
                      "hidden": true
                    },
                    "sort": 6,
                    "remarks": "@ctitle",
                    "createTime": "@date",
                    "updateTime": "@date",
                    "children": []
                  },
                  ]
                }
              ]
            },
            {
              "id": "3",
              "parentId": null,
              "type": "1",
              "path": "/baidu",
              "name": "Baidu", // 路由名称
              "code": "Baidu", // 权限标识
              "redirect": null,
              "component": "link/index.vue",
              "meta": {
                "title": "仓库管理",
                "icon": "i-fe-archive",
                "linkTo": 'https://www.baidu.com', // 外链跳转地址
                "cache": true,
                "hidden": false,
                "isBreadcrumd": true,
              },
              "sort": 4,
              "remarks": "@ctitle",
              "createTime": "@date",
              "updateTime": "@date",
              "children": []
            }
          ]
        },

      }
    },
  },
  {
    url: "/dev-api/system/menu/:id",
    timeout: 5000,
    method: "delete",
    response: () => {
      return {
        "status": 200,
        "message": "删除成功",
        "data": true
      }
    }
  },
  {
    url: "/dev-api/system/menu/select",
    timeout: 5000,
    method: "get",
    response: () => {
      return {
        "status": 200,
        "msg": "查询成功",
        "data": {
          "msg": "获取菜单成功",
          "results": [
            {
              "id": "2",
              "parentId": null,
              "title": "系统管理",
              "children": [
                {
                  "id": "21",
                  "parentId": "2",
                  "title": '菜单管理',
                  "children": []
                },
                {
                  "id": "22",
                  "parentId": "2",
                  "title": '角色管理',
                  "children": []
                },
                {
                  "id": "23",
                  "parentId": "2",
                  "title": '用户管理',
                  "children": []
                }
              ]
            },
            {
              "id": "3",
              "parentId": null,
              "title": "仓库管理",
              "children": []
            }
          ]
        }
      }
    }
  },
  {
    url: "/dev-api/system/menu",
    timeout: 5000,
    method: "post",
    response: () => {
      return {
        "status": 20000,
        "message": "新增成功",
        "data": true
      }
    }
  },
  {
    url: "/dev-api/system/menu",
    timeout: 5000,
    method: "put",
    response: () => {
      return {
        "status": 20000,
        "message": "修改成功",
        "data": true
      }
    }
  },
] as MockMethod[]

